package demo.xlj.yuyi.studentapp.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import demo.xlj.yuyi.studentapp.entitiy.Announcement;
import demo.xlj.yuyi.studentapp.entitiy.User;
import demo.xlj.yuyi.studentapp.entitiy.AnnouncenmentNew;

import demo.xlj.yuyi.studentapp.greendao.AnnouncementDao;
import demo.xlj.yuyi.studentapp.greendao.UserDao;
import demo.xlj.yuyi.studentapp.greendao.AnnouncenmentNewDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig announcementDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig announcenmentNewDaoConfig;

    private final AnnouncementDao announcementDao;
    private final UserDao userDao;
    private final AnnouncenmentNewDao announcenmentNewDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        announcementDaoConfig = daoConfigMap.get(AnnouncementDao.class).clone();
        announcementDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        announcenmentNewDaoConfig = daoConfigMap.get(AnnouncenmentNewDao.class).clone();
        announcenmentNewDaoConfig.initIdentityScope(type);

        announcementDao = new AnnouncementDao(announcementDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        announcenmentNewDao = new AnnouncenmentNewDao(announcenmentNewDaoConfig, this);

        registerDao(Announcement.class, announcementDao);
        registerDao(User.class, userDao);
        registerDao(AnnouncenmentNew.class, announcenmentNewDao);
    }
    
    public void clear() {
        announcementDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        announcenmentNewDaoConfig.clearIdentityScope();
    }

    public AnnouncementDao getAnnouncementDao() {
        return announcementDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public AnnouncenmentNewDao getAnnouncenmentNewDao() {
        return announcenmentNewDao;
    }

}
